<div class="portlet light bordered">
	<div class="portlet-title">
		<div class="caption font-dark">
			<i class="fa fa-cog font-dark"></i> 
			<span class="caption-subject bold">修改分类</span>
		</div>
	</div>
	<div class="portlet-body form">
		<form role="form" action="/wxMpCustomMenu/edit" class="form-horizontal" method="post" enctype="multipart/form-data">
			<input type="hidden" name="key" value="$!wxButtion.key">
		 	 <div class="modal-body">
				<div class="form-group">
					<label class="control-label col-md-3">*上级类别：</label>
					<div class="col-md-7">
						<label class="control-label">
 								$!wxSubButtion.name
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-3">*菜单名称:</label>
					<div class="col-md-7">
						<input type="text" class="form-control" value="$!wxButtion.name" name="name" maxlength="7" required>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label col-md-3">菜单类型：</label>
					<div class="col-md-7">
						 <select class="form-control menuType" name="type">
						 	#foreach($!bnType in $!sysParamBnType.getSysListMap())
						 		
						 	<option #if($!bnType.type==$!wxButtion.type) selected="selected" #end value="$!bnType.type">$!bnType.name</option>
						 	
						 	#end
						 </select>
					</div>
				</div>
				<div class="form-group"  #if($!wxButtion.type != "view") style="display: none;" #end  id="menuUrl" >
					<label class="control-label col-md-3">访问网址：</label>
					<div class="col-md-7">
						<input type="text" class="form-control" name="url" #if($!redirect_uri)  value= "$!redirect_uri" #else value="$!wxButtion.url"   #end >
					</div>
				</div>
				<div class="form-group"  #if($!wxButtion.type != "miniprogram") style="display: none;" #end  id="menuAppID">
					<label class="control-label col-md-3">小程序的appid：</label>
					<div class="col-md-7">
						<input type="text" class="form-control" name="appid" value="$!wxButtion.appid">
					</div>
				</div>
				<div class="form-group"  #if($!wxButtion.type != "miniprogram") style="display: none;" #end  id="memnuAppPath">
					<label class="control-label col-md-3">小程序的页面路径：</label>
					<div class="col-md-7">
						<input type="text" class="form-control" name="pagepath" value="$!wxButtion.pagepath">
					</div>
				</div>
				<div class="form-group"  #if($!wxButtion.type == "click") style="display: none;"  #end  id="memnuSuffix">
					<label class="control-label col-md-3">网址添加前后缀：</label>
					<div class="col-md-7 form-control-static">
                      	<label class="mt-checkbox mt-checkbox-outline">
							<input #if($!state)  checked #end type="checkbox" value="true" name="state" >
							<span></span>
						</label>
                    </div>
				</div>
			</div>
			<div class="form-actions right">
                 <a href="javascript:;" thref="/wxMpCustomMenu/list" class="btn green ajax-file"><i class="fa fa-check"></i> 提交</a>
                 <a href="javascript:;" data-dismiss="modal" class="btn btn-outline grey-salsa">返回</a>
            </div>
		</form>
	</div>
</div>
<script src="/assets/scripts/views-file-edit.js" type="text/javascript"></script>
<script src="/assets/plugins/bootstrap-select/js/components-bootstrap-select.js" type="text/javascript"></script>
<script type="text/javascript">
 $(".menuType").change(function(){
	  var wxType= $(this).val();
	  var menuUrl = $("#menuUrl");
	  var memnuSuffix = $("#memnuSuffix");
	  var menuAppID =$("#menuAppID");
	  var memnuAppPath =$("#memnuAppPath");
// 	  var menuText =$("#menuText");
	  
	  if(wxType== "view"){
		  menuUrl.show();
		  memnuSuffix.show();
		  menuAppID.hide();
		  memnuAppPath.hide();
// 		  menuText.hide();
	  }else if(wxType == "miniprogram"){
		  menuUrl.show();
		  memnuSuffix.show();
		  menuAppID.show();
		  memnuAppPath.show();
// 		  menuText.hide();
	  }
	  else if(wxType == "click"){
		  menuUrl.hide();
		  memnuSuffix.hide();
		  menuAppID.hide();
		  memnuAppPath.hide();
// 		  menuText.show();
	  }
 });
</script>